<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>ERP</title>
    <style>
        h1 {
            font-size: 2em; /* 设置字体大小 */
            color: #4CAF50; /* 设置字体颜色 */
            text-align: center; /* 设置文本居中 */
            padding: 20px; /* 设置内边距 */
            border-bottom: 2px solid #4CAF50; /* 设置下边框 */
        }        
        h2 {
            font-size: 1.5em; /* 设置字体大小 */
            color: #333; /* 设置字体颜色 */
            text-align: left; /* 设置文本居左对齐 */
            padding: 10px; /* 设置内边距 */
            border-bottom: 1px solid #333; /* 设置下边框 */
        }
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f0f0f0;
        }
        .container {
            width: 80%;
            margin: 0 auto;
            padding: 20px;
        }
        form {
            background-color: #fff;
            padding-top: 10px;
            padding-left: 20px;
            padding-right: 20px;
            border-radius: 5px;
            display: flex;
            justify-content: space-between;
            border-bottom: 1px solid #ddd;
        }
        label {
            display: block;
            margin-bottom: 10px;
        }
        input[type="text"], input[type="number"], input[type="date"] {
            width: 100%;
            padding: 10px;
            border-radius: 5px;
            border: 1px solid #ccc;
        }
        input[type="submit"] {
            background-color: #4CAF50;
            color: white;
            padding: 14px 20px;
            margin: 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        input[type="submit"]:hover {
            background-color: #45a049;
        }
        a {
            display: inline-block;
            margin: 10px 0;
            padding: 10px;
            background-color: #008CBA;
            color: white;
            text-decoration: none;
            border-radius: 5px;
        }
        a:hover {
            background-color: #007B9A;
        }
        form:hover {background-color: #f5f5f5;}
    </style>
</head>
<body>
    <div class="container">
        <a href="/" >物料计算</a>
        <a href="/func">资产管理</a>
        <a href="/store" style="background-color: gray">库存管理</a>
        <h1>ERP 库存</h1>
        <h2>物料库存</h2>
        {% for item in store %}
        <form action="/store/" enctype="application/x-www-form-urlencoded" method="post">
            <label>
                物料：<input type="text" name="pname" required value="{{ item[0] }}" readonly>
            </label>
            <label>
                工序库存：<input type="number" name="num1" required value="{{ item[1] }}"
                                oninput="value=value.replace('-', '');value=value.replace('.', '')">
            </label>
            <label>
                资材库存：<input type="number" name="num2" required value="{{ item[2] }}"
                                oninput="value=value.replace('-', '');value=value.replace('.', '')">
            </label>
            <input type="submit" value="修改">
        </form>
        {% endfor %}
    </div>



</body>
</html>